package com.example.webfluxr2dbcdemo.controller;

import com.example.webfluxr2dbcdemo.bean.AdVo;
import com.example.webfluxr2dbcdemo.service.AdServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @Author: zhangQi
 * @Date: 2020-09-30 16:56
 * http://www.zyiz.net/tech/detail-144512.html
 */
@RestController
@RequestMapping("/api/ad")
public class AdController {
    @Autowired
    private AdServiceImpl adService;

    @GetMapping("/findAll")
    public Flux<AdVo> findNowAd(){
        return adService.findAll();
    }
}
